/*
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <plugins/plugin.h>
#include <plugins/plugin_loader.h>

plugin_t *attr_plugin_create();
plugin_t *kernel_libipsec_plugin_create();
plugin_t *kernel_pfkey_plugin_create();
plugin_t *kernel_netlink_plugin_create();
plugin_t *resolve_plugin_create();
plugin_t *socket_default_plugin_create();
plugin_t *farp_plugin_create();
plugin_t *stroke_plugin_create();
plugin_t *vici_plugin_create();
plugin_t *updown_plugin_create();
plugin_t *eap_identity_plugin_create();
plugin_t *eap_mschapv2_plugin_create();
plugin_t *xauth_generic_plugin_create();
plugin_t *counters_plugin_create();

static void register_plugins() __attribute__ ((constructor));
static void register_plugins()
{
	plugin_constructor_register("attr", attr_plugin_create);
	plugin_constructor_register("kernel-libipsec", kernel_libipsec_plugin_create);
	plugin_constructor_register("kernel-pfkey", kernel_pfkey_plugin_create);
	plugin_constructor_register("kernel-netlink", kernel_netlink_plugin_create);
	plugin_constructor_register("resolve", resolve_plugin_create);
	plugin_constructor_register("socket-default", socket_default_plugin_create);
	plugin_constructor_register("farp", farp_plugin_create);
	plugin_constructor_register("stroke", stroke_plugin_create);
	plugin_constructor_register("vici", vici_plugin_create);
	plugin_constructor_register("updown", updown_plugin_create);
	plugin_constructor_register("eap-identity", eap_identity_plugin_create);
	plugin_constructor_register("eap-mschapv2", eap_mschapv2_plugin_create);
	plugin_constructor_register("xauth-generic", xauth_generic_plugin_create);
	plugin_constructor_register("counters", counters_plugin_create);
}

static void unregister_plugins() __attribute__ ((destructor));
static void unregister_plugins()
{
	plugin_constructor_register("attr", NULL);
	plugin_constructor_register("kernel-libipsec", NULL);
	plugin_constructor_register("kernel-pfkey", NULL);
	plugin_constructor_register("kernel-netlink", NULL);
	plugin_constructor_register("resolve", NULL);
	plugin_constructor_register("socket-default", NULL);
	plugin_constructor_register("farp", NULL);
	plugin_constructor_register("stroke", NULL);
	plugin_constructor_register("vici", NULL);
	plugin_constructor_register("updown", NULL);
	plugin_constructor_register("eap-identity", NULL);
	plugin_constructor_register("eap-mschapv2", NULL);
	plugin_constructor_register("xauth-generic", NULL);
	plugin_constructor_register("counters", NULL);
}

